from app.core.status_codes import ERROR_MESSAGES

def GetErrorMsg(code):
    """
    根据业务码获取错误信息
    :param code: 业务码
    :return: 错误信息
    """
    return ERROR_MESSAGES.get(code, "Unknown error")

def get_response(code, data=None):
    """
    返回规范化响应
    :param code: 业务码
    :param data: 响应数据
    :return: dict
    """
    return {
        "code": code,
        "msg": GetErrorMsg(code),
        "data": data
    }

